package com.yunxi.service.dubboService.impl.finance;

import com.github.pagehelper.PageInfo;
import com.yunxi.finance.pojo.VehiclePriceDetailVO;
import com.yunxi.finance.service.VehiclePriceDetailDubboService;
import com.yunxi.model.finance.VehiclePriceDetail;
import com.yunxi.service.localService.finance.VehiclePriceDetailService;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;

import java.lang.reflect.InvocationTargetException;
import java.util.List;

/**
 * <p>
 * 车辆价格 服务实现类
 * </p>
 *
 * @author 
 * @since 2019-06-17
 */
public class VehiclePriceDetailDubboServiceImpl implements VehiclePriceDetailDubboService {

    @Autowired
    @Qualifier(value = "vehiclePriceDetailServiceImpl")
    VehiclePriceDetailService vehiclePriceDetailService;


    @Override
    public VehiclePriceDetailVO getById(String id) throws InvocationTargetException, IllegalAccessException {
    VehiclePriceDetail VehiclePriceDetail = vehiclePriceDetailService.getById(id);
    VehiclePriceDetailVO VehiclePriceDetailVO = new VehiclePriceDetailVO();
        BeanUtils.copyProperties(VehiclePriceDetail,VehiclePriceDetailVO);
        return VehiclePriceDetailVO;
    }

    @Override
    public void saveOrUpdate(VehiclePriceDetailVO VehiclePriceDetailVO) throws InvocationTargetException, IllegalAccessException {
    VehiclePriceDetail VehiclePriceDetail = new VehiclePriceDetail();
        BeanUtils.copyProperties(VehiclePriceDetailVO,VehiclePriceDetail);
        vehiclePriceDetailService.saveOrUpdate(VehiclePriceDetail);
    }

    @Override
    public void removeById(String id) {
        vehiclePriceDetailService.removeById(id);
    }

    @Override
    public PageInfo<VehiclePriceDetailVO> findPageByVO(VehiclePriceDetailVO vehiclePriceDetailVO, Integer pageNum, Integer pageSize) throws InvocationTargetException, IllegalAccessException {
      PageInfo<VehiclePriceDetailVO> pageInfo = vehiclePriceDetailService.pageByVo(vehiclePriceDetailVO,pageNum,pageSize);
      return pageInfo;
   }

    @Override
    public void removeByListVo(List<VehiclePriceDetailVO> VehiclePriceDetailVOList) throws IllegalAccessException, InvocationTargetException, InstantiationException {
        vehiclePriceDetailService.removeByListVo(VehiclePriceDetailVOList);
    }

    @Override
    public List listByVo(VehiclePriceDetailVO VehiclePriceDetailVO) {
      return vehiclePriceDetailService.listByVo(VehiclePriceDetailVO);
    }
}
